﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Simple.Repository.Models.DeviceManagement;

namespace Simple.Services.System.DeviceManagement.Models
{
    public class DeviceCreateOrUpdateModel : ModelBase
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        public Guid? Id { get; set; } = null;

        /// <summary>
        /// 设备名称
        /// </summary>
        [Required(ErrorMessage = "设备名称不能为空")]
        public string Name { get; set; }

        /// <summary>
        /// 设备的ip地址
        /// </summary>
        [Required(ErrorMessage = "ip地址不能为空")]
        public string IpAddress { get; set; }

        /// <summary>
        /// 设备号/编号
        /// </summary>
        public string Number { get; set; }

        /// <summary>
        /// 绑定班级
        /// </summary>
        public Guid? ClassesId { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public int EnumDeviceType { get; set; }

        /// <summary>
        /// 设备序列号
        /// </summary>
        public string? DeviceKey { get; set; }

        /// <summary>
        /// 设备密码
        /// </summary>
        public string? DeviceSecret { get; set; }

        /// <summary>
        /// 适用人群
        /// </summary>
        public List<int>? ApplicablePopulation { get; set; }

        /// <summary>
        /// 是否刷脸
        /// </summary>
        public bool? IsFace { get; set; }

        /// <summary>
        /// 是否刷卡
        /// </summary>
        public bool? IsCard { get; set; }

        public override void ConfigureMapper(Profile profile)
        {
            profile.CreateMap<Device, DeviceCreateOrUpdateModel>();
            profile.CreateMap<DeviceCreateOrUpdateModel, Device>();
        }
    }
}
